package net.vanchu.mortgagecalculator.mortgage.data.repaymentSummary;

import net.vanchu.mortgagecalculator.mortgage.data.PrincipalAndInterest;
import net.vanchu.mortgagecalculator.mortgage.data.monthRepayment.MixMonthRepay;
import net.vanchu.mortgagecalculator.mortgage.data.monthRepayment.SingleMonthRepay;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Granton on 2016/12/21.
 */
public class PrincipalBalancedPart implements Serializable {

    private double decreaseNumber;

    private double firstRepayNumber;

    public PrincipalBalancedPart(double decreaseNumber, double firstRepayNumber) {
        this.decreaseNumber = decreaseNumber;
        this.firstRepayNumber = firstRepayNumber;
    }

    public double getDecreaseNumber() {
        return decreaseNumber;
    }

    public double getFirstRepayNumber() {
        return firstRepayNumber;
    }


    public static class Mix extends PrincipalBalancedPart {

        private List<MixMonthRepay> mixMonthRepays;

        private PrincipalAndInterest comPrincipalAndInterest;

        private PrincipalAndInterest proPrincipalAndInterest;

        public Mix(double decreaseNumber, double firstRepayNumber,
                   List<MixMonthRepay> mixMonthRepays,
                   PrincipalAndInterest comPrincipalAndInterest,
                   PrincipalAndInterest proPrincipalAndInterest) {
            super(decreaseNumber, firstRepayNumber);
            this.mixMonthRepays = mixMonthRepays;
            this.comPrincipalAndInterest = comPrincipalAndInterest;
            this.proPrincipalAndInterest = proPrincipalAndInterest;
        }

        public List<MixMonthRepay> getMixMonthRepays() {
            return mixMonthRepays;
        }

        public PrincipalAndInterest getComPrincipalAndInterest() {
            return comPrincipalAndInterest;
        }

        public PrincipalAndInterest getProPrincipalAndInterest() {
            return proPrincipalAndInterest;
        }
    }

    public static class Single extends PrincipalBalancedPart {

        private List<SingleMonthRepay> singleMonthRepays;

        private PrincipalAndInterest principalAndInterest;

        public Single(double decreaseNumber, double firstRepayNumber,
                      List<SingleMonthRepay> singleMonthRepays,
                      PrincipalAndInterest principalAndInterest) {
            super(decreaseNumber, firstRepayNumber);
            this.singleMonthRepays = singleMonthRepays;
            this.principalAndInterest = principalAndInterest;
        }

        public List<SingleMonthRepay> getSingleMonthRepays() {
            return singleMonthRepays;
        }

        public PrincipalAndInterest getPrincipalAndInterest() {
            return principalAndInterest;
        }
    }
}